Macroeconometrics Project

Summary

Motivation:

The purpose of this course is to get a theoretical and practical understanding of empirical methods for business cycle analysis and forecasting. The two main classes of models used for this purpose in research and policy environments alike are the Dynamic Factor Model (DFM) and Vector Autoregressions (VAR). Accordingly, I aim to conduct a simple exercise where I compare the forecasting performance of these two popular models for the real GDP growth of the euro area. In particular, I will use similar versions of the models where I have mixed frequencies (i.e., low frequency of quarterly and high frequency of monthly) and an unbalanced panel of data (i.e., ragged edges). Further, I specify the same small-to-medium-size model (between 6 and 15 variables) for both models and perform estimation using Bayesian techniques. The models will be similar in spirit to Camacho and Perez-Quiros (2010) for the DFM and to Schorfheide and Song (2015) for the VAR.
The analysis will consist of providing point and density forecasts (i.e., median and percentiles of the posterior distribution) for the euro area real GDP growth over the short term. Then, I will contrast the forecasting ability of these two models by comparing them with the ECB official macroeconomic projections for the euro area growth (i.e., the ECB projections are conducted using a suite of state-of-the-art models, so it is a challenging benchmark to beat). Finally, I will compare the in-sample forecast performance of the models (compare the RMSE).
This exercise will shed light on whether there are relevant differences between the DFMs and VARs in terms of forecasting and whether they are able to provide similar growth forecasting profiles as the ones from professional models used in the ECB to conduct macroeconomic projections.

Scope:

Target
Models
Analysis

Specification:

Dynamic Factor Model (e.g., Q=1, M=2)
Model:
State-space representation:
Note: For Bayesian estimation we rewrite the model as a linear regression in that we include the dynamics (i.e., autoregressive polynomial) of the idiosyncratic component in the measurement equation. Further, for simplicity we assume no idiosyncratic dynamics of the quarterly/low-frequency target variable.
Vector Autoregression (e.g., Q=1, M=2)
Model:
=.
State-space representation:
Note: For Bayesian estimation the series enter in (log) levels since we assume a Minnesota-type prior with the variables following a random walk.
References
Camacho, Maximo, and Gabriel PerezQuiros. "Introducing the eurosting: Shortterm indicator of euro area growth." Journal of Applied Econometrics 25, no. 4 (2010): 663-694.
Schorfheide, Frank, and Dongho Song. "Real-time forecasting with a mixed-frequency VAR." Journal of Business & Economic Statistics 33, no. 3 (2015): 366-380.
@Erik Andres Escayola

Main script

Data description
(Mnemonic -> Variable - Sector - Type - Frequency)
1 GDP -> Real GDP - Activity - Hard - Q
2 PMI -> Composite output PMI - Activity - Soft - M
3 ESI -> Economic sentiment - Activity - Soft - M
4 IP -> Industrial production manufacturing - Activity - Hard - M
5 RS -> Retail sales - Activity - Hard - M
6 EMP -> Unemployment rate - Activity - Hard -M
7 EEXP-> Extra-euro area exports - Activity - Hard - M
8 CPI -> Consumer prices - Prices - Hard - M
9 REER-> Real effective exchange rate - Prices - Hard - M
10 COM -> Commodity spot aggregate - Prices - Hard - M
11 CISS-> Sovereign stress - Financial - Hard/Soft - M
12 EQTY-> EURO STOXX 50 - Financial - Hard - M
13 INT -> Short-term interest rate & shadow rate - Financial - Hard/Soft - M
14 EPU -> Economic policy uncertainty - Other - Soft - M
15 SBI -> Supply-bottleneck - Other - Soft - M
Note: always put quarterly variables first
Housekeeping
The house is clean!
Data loading and wrangling
Enter data file name:
File name: data.xlsx
Select variables:
Variables selected:
GDP IP RS CISS EQTY INT EPU SBI
Select upper bound credible band:
Upper credible band 84% Lower credible band 16%
Preprocess data:
Model estimation
Gibbs sampler draws:
Number of draws to keep: 1600 Number of draws to burn: 400 Total number of draws: 2000
Estimate DFM:
Starting Mixed Frequency Bayesian DFM estimation... Correlation between predicted target using common component vs common and idiosyncratic component (monthly): 0.97 Correlation between target vs predicted target using common component (quarterly): 0.98
DFM estimation finished!
Estimate VAR:
Starting Mixed Frequency Bayesian VAR estimation...
VAR estimation finished!
Comparison analysis wrt ECB projections
Enter ECB projections file name:
File name: ECB_projections.xlsx
Select specs:
Number of years back: 5
Run comparison with latest ECB projections:
Forecast correlation between ECB Mar23 MPE and DFM: -0.29 Forecast correlation between ECB Mar23 MPE and VAR: -0.32
Comparison analysis between models
Select specs:
Run expanding window forecast exercise:
This could take a while...
Total number of forecast iterations: 8
DFM forecast iteration progress: 12.5% Starting Mixed Frequency Bayesian DFM estimation... Correlation between predicted target using common component vs common and idiosyncratic component (monthly): 0.97 Correlation between target vs predicted target using common component (quarterly): 0.98 Actual vs forecast values for horizons: 0.6579 -0.2468 DFM forecast iteration progress: 25.0% Starting Mixed Frequency Bayesian DFM estimation... Correlation between predicted target using common component vs common and idiosyncratic component (monthly): 0.97 Correlation between target vs predicted target using common component (quarterly): 0.98 Actual vs forecast values for horizons: 0.8040 -0.3342 DFM forecast iteration progress: 37.5% Starting Mixed Frequency Bayesian DFM estimation... Correlation between predicted target using common component vs common and idiosyncratic component (monthly): 0.97 Correlation between target vs predicted target using common component (quarterly): 0.97 Actual vs forecast values for horizons: 0.4623 -0.7151 DFM forecast iteration progress: 50.0% Starting Mixed Frequency Bayesian DFM estimation... Correlation between predicted target using common component vs common and idiosyncratic component (monthly): 0.97 Correlation between target vs predicted target using common component (quarterly): 0.98 Actual vs forecast values for horizons: -0.0896 0.0347 DFM forecast iteration progress: 62.5% Starting Mixed Frequency Bayesian DFM estimation... Correlation between predicted target using common component vs common and idiosyncratic component (monthly): 0.97 Correlation between target vs predicted target using common component (quarterly): 0.98 Actual vs forecast values for horizons: 0.0941 0.1552 DFM forecast iteration progress: 75.0% Starting Mixed Frequency Bayesian DFM estimation... Correlation between predicted target using common component vs common and idiosyncratic component (monthly): 0.97 Correlation between target vs predicted target using common component (quarterly): 0.98 Actual vs forecast values for horizons: 0.1325 0.1195 DFM forecast iteration progress: 87.5% Starting Mixed Frequency Bayesian DFM estimation... Correlation between predicted target using common component vs common and idiosyncratic component (monthly): 0.97 Correlation between target vs predicted target using common component (quarterly): 0.98 Actual vs forecast values for horizons: -0.1235 -0.5570 DFM forecast iteration progress: 100.0% Starting Mixed Frequency Bayesian DFM estimation... Correlation between predicted target using common component vs common and idiosyncratic component (monthly): 0.97 Correlation between target vs predicted target using common component (quarterly): 0.98 Actual vs forecast values for horizons: 0.0403 -0.2021
VAR forecast iteration progress: 12.5% Starting Mixed Frequency Bayesian VAR estimation... Actual vs forecast values for horizons: 0.6579 0.3433 VAR forecast iteration progress: 25.0% Starting Mixed Frequency Bayesian VAR estimation... Actual vs forecast values for horizons: 0.8040 -0.1392 VAR forecast iteration progress: 37.5% Starting Mixed Frequency Bayesian VAR estimation... Actual vs forecast values for horizons: 0.4623 0.0732 VAR forecast iteration progress: 50.0% Starting Mixed Frequency Bayesian VAR estimation... Actual vs forecast values for horizons: -0.0896 0.1218 VAR forecast iteration progress: 62.5% Starting Mixed Frequency Bayesian VAR estimation... Actual vs forecast values for horizons: 0.0941 0.2242 VAR forecast iteration progress: 75.0% Starting Mixed Frequency Bayesian VAR estimation... Actual vs forecast values for horizons: 0.1325 0.4300 VAR forecast iteration progress: 87.5% Starting Mixed Frequency Bayesian VAR estimation... Actual vs forecast values for horizons: -0.1235 -0.1367 VAR forecast iteration progress: 100.0% Starting Mixed Frequency Bayesian VAR estimation... Actual vs forecast values for horizons: 0.0403 -0.4110
Results report
Click on "Hide code" on the right of the "Live Editor" file to see results only.
Build the report (displaying code sections):
Report done!